package cn.cmcc.online.smsapi.sdk.queue;

import java.util.HashMap;
/*SDK-458 hewengao 20160525 start */
import java.util.Map;
/*SDK-458 hewengao 20160525 end */
public class TaskInfo {

	 int type;//任务类型 1:查询归属地 如参数先将参数入库,后再查询    simIccid,smsLocate,receiveNum,centerNum,sceneId,sms; 
	// 2://更新算法 
	 HashMap<String,String> paramsMap=null;//任务参数
	 /*SDK-458 hewengao 20160525 start */
	 private Map extend =null;
	 /*SDK-458 hewengao 20160525 end */
	 public TaskInfo(int type,String... params){
		 this.type = type;
		 if(params !=null && params.length %2 ==0 && params.length > 0){
			 this.paramsMap = new HashMap<String,String>();
			 int len = params.length;
			for (int i = 0; i < len; i += 2) {
				if (params[i + 1] != null && !params[i + 1].equals("")){
					this.paramsMap.put(params[i], params[i+1]);
				}
			}
		 }
	 }
	 /*SDK-458 hewengao 20160525 start */
	 public void setExtend(Map extend){
		 this.extend = extend;
	 }
	 public Map getExtend(){
		 return extend;
	 }
	 /*SDK-458 hewengao 20160525 end */
//	@Override
//	public String toString() {
//		StringBuffer sb = new StringBuffer();
//		  if(paramsMap!=null&&paramsMap.isEmpty()) { for( Entry<String,String> entry
//		           :paramsMap.entrySet()) {
//			  sb.append("key="+entry.getKey()).append("value="+entry.getValue());
//			  }
//		  }
//		return "TaskInfo [type=" + type + ", paramsMap=" + 		        
//		sb.toString()+ "]";
//	}
	 
	 
}
